/**
 * {作业名称}
 *
 * 输入参数:
 *
 * 输出参数:
 *
 */
(() => {
  // 私有区域

  return function ({ UID, ...args }) {
    // 验证输入参数
    if (!UID) throw Error("无效会话");

    switch (args.action) {
      case 'get': {
        const { Filter, Order, PageSize, PageNo } = args;
        return A.job.CardR({
          UID,
          Card: "流水码规则",
          Model: ["卡片数据.卡片.名称", "卡片数据.名称", "首段脚本", "流水段长度", "尾段脚本", "流水标识起始", "流水标识长度"],
          Filter, Order, PageSize, PageNo,
        });
      }
      case 'get-childs': {
        const { Filter, Order, PageSize, PageNo } = args;
        return A.job.CardR({
          UID,
          Card: "流水码",
          Model: ["流水标识", "最大值", "规则"],
          Filter, Order, PageSize, PageNo,
        });
      }
      case 'set-child': {
        const { Record } = args;
        return A.job.CardW({
          UID,
          Card: "流水码",
          Model: ["最大值", "规则"],
          Record,
        });
      }
      case 'del-child': {
        const { Record } = args;
        return A.job.CardD({
          UID,
          Card: "流水码",
          Record,
        });
      }
    }
  };
})()